package com.android.customviewgroup.viewholder;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.text.TextWatcher;
import android.view.View;

import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes;
import androidx.annotation.StringRes;

/**
 * Created by 小神有礼了
 * Time: 2/20/22 1:43 AM
 * Mail: 5267621@qq.com
 */
public interface IViewHolder {
    /**
     * This view is visible.
     * Use with {@link #setVisibility} and <a href="#attr_android:visibility">{@code
     * android:visibility}.
     */
    public static final int VISIBLE = 0x00000000;

    /**
     * This view is invisible, but it still takes up space for layout purposes.
     * Use with {@link #setVisibility} and <a href="#attr_android:visibility">{@code
     * android:visibility}.
     */
    public static final int INVISIBLE = 0x00000004;

    /**
     * This view is invisible, and it doesn't take any space for layout
     * purposes. Use with {@link #setVisibility} and <a href="#attr_android:visibility">{@code
     * android:visibility}.
     */
    public static final int GONE = 0x00000008;

    View getConvertView();

    <T extends View> T getView(int viewId);

    CharSequence getText(@IdRes int viewId);

    int getVisibility(@IdRes int viewId);

    IViewHolder setVisibility(@IdRes int viewId, int visibility);

    IViewHolder setEnabled(@IdRes int viewId, boolean enabled);

    IViewHolder setCheckBox(@IdRes int viewId, boolean checked);

    IViewHolder setText(@IdRes int viewId, @StringRes int resId);

    IViewHolder setText(@IdRes int viewId, CharSequence text);

    IViewHolder setTextColor(int viewId, @ColorInt int textColor);

    IViewHolder setTextColorRes(int viewId, @ColorRes int resId);

    IViewHolder setHint(@IdRes int viewId, @StringRes int resId);

    IViewHolder setHint(@IdRes int viewId, CharSequence text);

    IViewHolder setOnClickListener(int viewId, View.OnClickListener listener);

    IViewHolder setOnClickListener(int viewId, Object tag, View.OnClickListener listener);

    IViewHolder setOnLongClickListener(int viewId, View.OnLongClickListener listener);

    IViewHolder setOnLongClickListener(int viewId, Object tag, View.OnLongClickListener listener);

    IViewHolder setOnTouchListener(int viewId, View.OnTouchListener listener);

    IViewHolder addTextChangedListener(int viewId, TextWatcher listener);

    IViewHolder setBackgroundResource(@IdRes int viewId, @DrawableRes int drawable);

    IViewHolder setBackgroundColor(@IdRes int viewId, @ColorRes int colorId);

    IViewHolder setImageResource(@IdRes int viewId, @DrawableRes int drawableId);

    IViewHolder setImageResource(@IdRes int viewId, Drawable drawable);

    IViewHolder setImageResource(@IdRes int viewId, Bitmap bitmap);

    IViewHolder setImageURI(@IdRes int viewId, Uri uri);

    IViewHolder setColorFilter(int viewId, @ColorRes int resId);

    IViewHolder inflate(int viewId);

    IViewHolder recycle();
}
